﻿using System.ComponentModel;
using System.Diagnostics;

namespace MatrixEditor
{
	internal class Utilities
	{
		public static void OpenUrlOrFile(string url_or_file)
		{
			var process = new Process();

			try
			{
				process.StartInfo.FileName = @"iexplore.exe";
				process.StartInfo.Arguments = url_or_file;
				process.Start();
			}
			catch (Win32Exception)
			{
				try
				{
					process.StartInfo.FileName = @"explorer.exe";
					process.StartInfo.Arguments = url_or_file;
					process.Start();
				}
				catch (Win32Exception)
				{
					process.StartInfo.FileName = url_or_file.Trim();
					process.Start();
				}
			}

			process.Dispose();
		}
	}
}
